package py.edu.ucsa.sisale.util;

import org.apache.commons.codec.binary.Base64;
import org.apache.http.client.methods.HttpRequestBase;

import py.edu.ucsa.sisale.config.ConfigurationFactory;

public abstract class ServiceConfig {
	
	
	public void setAuthorizationHeader(HttpRequestBase request){
		String token = ConfigurationFactory.getConfig().getUser() + ":" + ConfigurationFactory.getConfig().getPass();
    	Base64 enc = new Base64();
		String encodedAuthorization = enc.encodeAsString(token.getBytes());
    	request.setHeader("Authorization", "Basic " + encodedAuthorization); 
	}

}
